package math;

import java.util.ArrayList;
import java.util.List;

import math.common.MathCommon;


public class KurtosisBasedMethod implements MEstimate {
	

	
	public Double estimate(List<Double> V, List<Double> U) {
		//estimate b in Y=b*X, V=Y+eps, U=X+xi 
		//xi - normal distribution
		Double b11 = new LeastSquareMethod().estimate(V, U);
		Double b12 = new WLeastSquareMethod().estimate(V, U);
		
		Double m4 = MathCommon.getUnb4Moment(U);
		Double cov = MathCommon.getCov(V, U);
			
		return b11*(b11*b12*m4 - 3*cov*cov)/(b11*b11*m4 - 3*cov*cov); 
	}

	@Override
	public Vector2D estimateFull(List<Double> V, List<Double> U) {
		// TODO Auto-generated method stub
		return null;
	}
}
